home *** CD-ROM | disk | FTP | other *** search
- Path: anchor.gsfc.nasa.gov!jyli
- From: "Jason Y. Li" <jyli@anchor.gsfc.nasa.gov>
- Newsgroups: comp.lang.c
- Subject: [Q] unpack 10 bit data
- Date: Wed, 17 Apr 1996 23:19:10 -0400
- Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
- Message-ID: <Pine.SGI.3.91.960417231151.16763A-100000@anchor.gsfc.nasa.gov>
- NNTP-Posting-Host: anchor.gsfc.nasa.gov
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
-
-
- I am looking for an efficient and elegant way of unpacking 10 bit data.
- In many scientific applications, raw data are packed into 10 bit data
- stream. For example, an input buffer of 40 bits (5 characters) contains
- four 10-bit integers. I know one way of unpacking the data which involves
- bit masking and then shifting left-and-right. It looks pretty messy to me. I
- am sure smart folks out there have better ways or ideas. I'd appreciate
- if you would let me know.
-
- Thanks in advance
-
-
- ========================================================================
- Jason Y. Li | Tel : (301) 286-1029
- Code 913 | Fax : (301) 286-1759
- NASA Goddard Space Flight Center | www : http://climate.gsfc.nasa.gov
- Greenbelt, MD 20771, USA | email: jyli@climate.gsfc.nasa.gov
- ========================================================================
- Beauty of style, harmony, grace and good rhythm depend on simplicity.
-
-
-